//created by: Justina Lee

Ext.define("MajorProjectSenchaTouch.view.OpeningHoursModule.OpeningHoursTermDataview", {
    extend: 'Ext.DataView',
    xtype: 'openinghoursTermDV',
    requires:[
    'MajorProjectSenchaTouch.store.OpeningHoursTermInfo'
    ],
    config: {
        cls:'ohDataview',
        store:'OpeningHoursTermInfo' ,
        itemTpl: new Ext.XTemplate(
            '<tpl for=".">',
                '<article class="wrapper">',
                    '<header id="termDate">',
                        '<h2>{termDate}</h2>',
                    '</header>',
                    '<section class="ohContentWrapper">',
                        '<tpl for="opLocations">',
                            '<header class="locationHeader">',
                                '<h3>{locationName}</h3>',
                            '</header>',
                            '<section>',
                                '<table id="openingHoursTable">',
                                    '<tpl for="openingHours">',
                                        '<tr>',
                                            '<th>',
                                                '<h4>{description}</h4>',
                                            '</th>',
                                            '<th class="alignRight" id="ohDetail">',
                                                '<div class="alignLeft"><h4>{detail}</h4></div>',
                                            '</th>',
                                        '</tr>',
                                    '</tpl>',
                                '</table>',
                            '</section>',
                        '</tpl>',
                    '</section>',
                '</article>',
            '</tpl>'               
       ),
       listeners:{
            painted: function(){
                this.fireEvent('showIndicator', this);
            }
        }
    }
});